#ifndef NANE_LUASCRIPTOBJECT_H
#   define NANE_LUASCRIPTOBJECT_H

#   include "nane/ScriptSystem/IScriptSystem.h"

extern "C"
{
    #include "lua.h"
    #include "lauxlib.h"
}

namespace nane
{
    class LuaScriptObject
        : public IScriptObject
    {
    public:
        LuaScriptObject( lua_State* _state, const char* _rep = NULL );
        ~LuaScriptObject();
        
    public:
        bool Invoke( IInput* _args, IOutput* _results );
        const char* ToString();
        
    public:
        static int s_luaPushValues( lua_State* _state, IInput* _values );
        static int s_luaPopValues( lua_State* _state, int _valuesNum, IOutput* _output );
        static int s_luaPopResults( lua_State* _state, IOutput* _results );
        
    public:
        lua_State* m_state;
        int m_ref;
        const char* m_rep;
    };
}   // namespace nane

#endif	// NANE_LUASCRIPTOBJECT_H
